"use strict";
// 装饰器工厂
// 装饰器工厂是一个返回装饰器函数的函数，可以为装饰器添加参数，可以更灵活的控制装饰器的行为。
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
function logInfo(n) {
    // 这里return的才是真正的装饰器
    return function (target) {
        target.prototype.printInfo = function () {
            for (let i = 0; i < n; i++) {
                console.log(`我的名字是:${this.name},我的年龄是:${this.age}`);
            }
        };
    };
}
let Person514 = class Person514 {
    constructor(name, age) {
        this.name = name;
        this.age = age;
    }
    speak() {
        console.log('你好，夜南漫剪');
    }
};
Person514 = __decorate([
    logInfo(3)
], Person514);
const p514 = new Person514('夜南漫剪', 26);
p514.printInfo();
